package kr.hkit.powerjava.chapter07.chuji;

public class Two {

	private int num, reversenum;

	public Two(int num) {
		super();
		this.num = num;
	} // using field

	int reverse() {
		reversenum = 0;
		do {
			reversenum += num % 10;
			num /= 10;
			if (num > 0)
				reversenum *= 10;
		} while (num > 0);
		return reversenum;
	}

	@Override
	public String toString() {
		return "Two [기존의 수는" + num + ", 뒤집어진 수는" + reversenum + "]";
	}
	
	
}